package datastructure.apply.maze;

import java.util.Objects;

class Diamond {
    private int x;
    private int y;
    private int direction;

    public Diamond(int x, int y) {
        this.x = x;
        this.y = y;
        direction = -1;
    }

    public Diamond(int x, int y, int direction) {
        this.x = x;
        this.y = y;
        this.direction = direction;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public int getDirection() {
        return direction;
    }

    public void setDirection(int direction) {
        this.direction = direction;
    }

    @Override
    public String toString() {
        return "(" + x + ", " + y + ')' + ":" + direction;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Diamond diamond = (Diamond) o;
        return getX() == diamond.getX() && getY() == diamond.getY();
    }

    @Override
    public int hashCode() {
        return Objects.hash(getX(), getY());
    }
}
